﻿using JT808.Protocol;
using SuperSocket.SocketBase.Protocol;

namespace JT808_win
{
    public class JT808RequestInfo : IRequestInfo
    {
        public JT808RequestInfo(byte[] totalBuffer)
        {
            //2.将数组反序列化
            var jT808Package = JT880Tools.JT808Serializer.Deserialize(totalBuffer);
            this.Data = totalBuffer;
            Key = jT808Package.Header.MsgNum.ToString();
            this.jT808Package = jT808Package;
            //Key = ((header[0] * 256) + header[1]).ToString();
            //Body = System.Text.Encoding.UTF8.GetString(body, 0, body.Length);
            //IsHeart = string.Equals("2", Key);
        }
        public string Key { get; set; }
        public byte[] Data { get; set; }
        public JT808Package jT808Package { get; set; }
    }
}
